/* *
* redux 使用
*/

// import {createStore,applyMiddleware} from 'redux'
// import reduxLogger from 'redux-logger'
// import reduxThunk from 'redux-thunk'
// import * as actions from './actions'
// const init = {
//     pageNum : 1,
//     oppNum:2
// }
// const reducer = (state=init , action) => {
//     state = JSON.parse(JSON.stringify(state))
//     switch (action.type){
//         case actions.add : state.pageNum = action.data
//             break;
//         case '222': state.oppNum++
//             break
//     }
//
//     return state
// }
//
// const store = createStore(reducer , applyMiddleware(reduxLogger , reduxThunk))
// export default store

/* *
* redux-toolkit 使用
* */
import { configureStore } from '@reduxjs/toolkit'
import task from './features/taskSlice'

const store = configureStore({
    // 指定reducer
    reducer: {
        // 按模块管理各个切片
        task
    },
})

export default store
